<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition>

            <h3>Cadastro de professor</h3>

            <div id="stylized" class="myform">
                <div class="radio">



                    <h:outputLabel>Nome: <span class="small">Nome Completo</span></h:outputLabel>
                    <h:inputText id="nome" required="true" value="#{ProfessorController.professor.nome}" requiredMessage="Um nome é requerido">
                        <f:validateLength maximum="150"  />
                    </h:inputText>
<!--                    <p:message for="nome" display="icon" /> -->

                    <h:outputLabel>Data de Nascimento: <span class="small">Digite ou selecione</span></h:outputLabel>
                    <f:view contentType="text/html">
                        <p:calendar value="#{ProfessorController.professor.dataNascimento}" id="dataNascimento" required="true" requiredMessage="Data de Nascimento é requerida" />
                    </f:view>

                    <h:outputLabel>Sexo: <span class="small">selecione uma opção</span></h:outputLabel>

                    <h:selectOneRadio value="#{ProfessorController.professor.sexo}" required="true" id="sexo" requiredMessage="Assinale o sexo" layout="line" >
                        <f:selectItem  itemValue="m" itemLabel="Masculino"  />
                        <f:selectItem  itemValue="f" itemLabel="Feminino" />
                    </h:selectOneRadio>


                    <h:outputLabel>E-Mail: <span class="small">E-mail válido</span></h:outputLabel>
                    <h:inputText value="#{ProfessorController.professor.email}" validator="#{ValidatorSM.validateEmail}" required="true" requiredMessage="E-mail requerido" id="email">
                        <f:validateLength maximum="320" />
                    </h:inputText>

                    <h:outputLabel>Usuario: <span class="small">Nome de Usuario</span></h:outputLabel>
                    <h:inputText value="#{ProfessorController.usuario.usuario}" id="usuario" required="true" requiredMessage="Usuário requerido">
                        <f:validateLength maximum="100"/>
                    </h:inputText>

                    <h:outputLabel>Senha: <span class="small">Senha de Acesso</span></h:outputLabel>
                    <h:inputSecret value="#{ProfessorController.usuario.pass}" id="senha" required="true" requiredMessage="Senha Requerida"></h:inputSecret>

                    <h:commandButton styleClass="button" action="#{ProfessorController.persiste}" value="Salvar" id="salvar" />
                    <h:commandButton styleClass="button" type="reset" value="Limpar" id="limpar" />

                </div>
            </div>
        </ui:composition>

    </body>
</html>
